// vite.config.js
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import tailwind from '@tailwindcss/vite'
import autoprefixer from 'autoprefixer'
import { fileURLToPath } from 'node:url'

export default defineConfig({
  plugins: [vue(), tailwind()],
  css: {
    postcss: {
      plugins: [
        autoprefixer()
      ],
    },
  },
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url))
    }
  },
  server: {
    proxy: {
      '/api': {
        target: 'http://localhost:8080',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, '')
      }
    }
  }
})